package org.ruanjj.inttoroman;

public class Solution {
    private String a;

    public Solution(){
        System.out.println("I am NoargConstructor");
    }
    public Solution(String a){
        this.a = a;
    }

    public String getA(){
        return a;
    }
    public String intToRoman(int num) {
        int[] value = new int[]{1000,900,500,400,100,90,50,40,10,9,5,4,1};
        String[] romanSymbol = new String[]{"M","CM","D","CD","C","XC","L","XL","X","IX","V","IV","I"};
        StringBuilder res = new StringBuilder();
        for(int i = 0; i < value.length; i++){
            while(num >= value[i]){
                num = num - value[i];
                res.append(romanSymbol[i]);
            }
        }
        return res.toString();
    }
}
